package com.hae.shop.member.model.reqDto;

import com.hae.shop.common.constant.Constants;
import com.hae.shop.common.util.annotation.MemberOf;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@ApiModel(value = "用户登录请求")
public class UserLoginReqDto implements Serializable {
    private static final long serialVersionUID = 1817556674674173107L;

    /**
     * 手机号码
     */
    @NotBlank(message = "手机号不能为空！")
    @Size(min = 11, max = 11, message = "手机长度11位！")
    @ApiModelProperty(value = "手机号码")
    private String mobile;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空！")
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 登陆类型 PC、Android 、IOS
     */
    @NotBlank(message = "登陆类型不能为空！")
    @MemberOf(member = {Constants.MEMBER_LOGIN_TYPE_ANDROID, Constants.MEMBER_LOGIN_TYPE_IOS, Constants.MEMBER_LOGIN_TYPE_PC},
            message = "登陆类型不合法！")
    @ApiModelProperty(value = "登陆类型")
    private String loginType;

    /**
     * 设备信息
     */
    @NotBlank(message = "设备信息不能为空！")
    @ApiModelProperty(value = "设备信息")
    private String deviceInfor;

}
